package com.ukao.steward.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.ukao.steward.R;
import com.ukao.steward.base.ListBaseAdapter;
import com.ukao.steward.base.SuperViewHolder;
import com.ukao.steward.bean.OrderClothingBean;

import java.util.List;

/**
 * Created by kefu001 on 2018/4/27.
 */

public class OrderGoodsAlreadyToShopAdapter extends ListBaseAdapter<OrderClothingBean> {
    public OrderGoodsAlreadyToShopAdapter(Context context, List<OrderClothingBean> mDataList) {
        super(context, mDataList);
    }

    @Override
    public int getLayoutId() {
        return R.layout.adapter_to_shop_goods_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        TextView tvOddNumbers= (TextView)holder.getView(R.id.odd_numbers);
        TextView tvAccessory=(TextView)holder.getView(R.id.accessory);
        TextView   tvName=(TextView)holder.getView(R.id.product_name);
        TextView  tvStatus=(TextView) holder.getView(R.id.status);
        OrderClothingBean clothingBean = super.mDataList.get(position);
        tvOddNumbers.setText(String.valueOf(clothingBean.getScanCode()));
        tvName.setText(clothingBean.getProductName());
        if (clothingBean.getType() == BatchGoodsAllAdapter.SHOW_ACCESSORY) {
            tvAccessory.setVisibility(View.VISIBLE);
        }
        if(tvStatus.getCurrentTextColor()!= Color.parseColor("#10c011")){
            tvStatus.setTextColor(Color.parseColor("#3db930"));
        }
        tvStatus.setText("已到店");
    }
}
